#ifndef LOCKFILE_H_
#define LOCKFILE_H_

#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <stdio.h>
#include "string"

typedef enum {
	LECTURA, ESCRITURA
} TMODO;

class LockFile {

private:

	struct flock fl;
	int fd;
	short tipoLock;
	std::string nombre;
	bool lockActivo;

public:

	LockFile(std::string nombre, TMODO modo);

	int tomarLock();
	int liberarLock();

};

#endif /* LOCKFILE_H_ */
